1. Field of the Invention
The present invention relates to a three-dimensional model display program and apparatus for displaying a three-dimensional model within a virtual three-dimensional space, and more particularly to a three-dimensional model display program and apparatus which are capable of turning a line-of-sight vector upward and downward.
2. Description of the Related Art
In recent years, the technique of displaying a three-dimensional model on a computer has been utilized in a lot of technical fields. For example, after a building is designed, a three-dimensional model representing the building is generated for display on a computer screen. This three-dimensional representation of the building enables the appearance of the building to be easily grasped. Further, if a viewpoint for displaying the three-dimensional model can be moved in response to user command, it is possible to display the three-dimensional model of the building from any desired viewpoint.
When it is required to display a three-dimensional model on a two-dimensional plane of a computer, projection processing is applied to the three-dimensional model. The projection processing is broadly classified into perspective projection and parallel projection. In displaying a moving image, perspective projection is generally used.
Perspective projection is characterized by utilizing perspective foreshortening and vanishing points. Perspective foreshortening is a phenomenon that when a line segment having a predetermined length is projected onto a two-dimensional plane, as the distance between the line segment and a viewpoint increases, the length of the line segment on the two-dimensional plane is reduced. A vanishing point is a point within a two-dimensional plane, to which converge two projected straight lines which are parallel with each other in the three-dimensional space.
Projection processing differs depending on the number of vanishing points. Projection processing performed with two vanishing points is called xe2x80x9ctwo-point perspective projectionxe2x80x9d, and projection processing performed with three vanishing points is referred to as xe2x80x9cthree-point perspective projectionxe2x80x9d. Two-point perspective projection is mainly employed when it is desired to give a sense of expansion of a building or the like in a horizontal direction, while three-point perspective projection is mainly employed when it is desired to give a sense of height of a building or the like.
FIGS. 23(A) and 23(B) are views of examples of representation by conventional perspective projection methods, in which FIG. 23(A) shows an example of an image displayed by two-point perspective projection, while FIG. 23(B) shows an example of an image displayed by three-point perspective projection.
As shown in FIG. 23(A), in two-point perspective projection, there are defined two vanishing points VP1, VP2. In this case, extensions of horizontally-extending line segments of a three-dimensional model 301 converge to either of the vanishing points VP1, VP2.
On the other hand, as shown in FIG. 23(B), in three-point perspective projection, there are defined three vanishing points VP3, VP4, VP5. In this case, extensions of horizontally-extending line segments of a three-dimensional model 302 converge to either of the vanishing points VP3, VP4, and extensions of vertically-extending line segments of the three-dimensional model 302 converge to the vanishing point VP5.
As described above, two-point perspective projection and three-point perspective projection are clearly distinguished from each other, and they are different in their applications. To generate a still image, one of the projection methods may be used which is more suitable for a scene to be displayed.
However, in generating a moving image, different scenes are required to be sequentially displayed, so that whichever projection method may be adopted, some scenes are inevitably displayed improperly.
For example, in viewpoint movement called walkthrough, it is necessary to seamlessly switch the direction of viewing from a viewpoint between a horizontal one to a vertical one. In such a case, if only one of the projection methods is employed, the formed image fails to give either a sense of lateral expansion or a sense of height. Further, if one projection method is alternately switched to the other during viewpoint movement, continuity of images cannot be maintained, which results in an unnatural moving image sequence.
It is an object of the invention to provide a three-dimensional model display program and a three-dimensional model display apparatus for displaying a three-dimensional model within a virtual three-dimensional space, which enable seamless switching between two-point perspective projection and three-point perspective projection.
To attain the above object, according to a first aspect of the invention, there is provided a three-dimensional model display program for displaying a three-dimensional model defined within a virtual three-dimensional space. This three-dimensional model display program is characterized by causing a computer to execute the processes of determining a line-of-sight vector indicative of a direction of viewing an inside of the virtual three-dimensional space from a viewpoint, in response to an operation input, determining a projection condition that two-point perspective projection is selected when the line-of-sight vector is close to a horizontal one, and a degree of influence of three-point perspective projection on two-point perspective projection increases with an increase in inclination of the line-of-sight vector with respect to a horizontal direction, generating an image by perspectively projecting the three-dimensional model according to the determined projection condition, and displaying the generated image.
To attain the above object, according to a second aspect of the invention, there is provided a three-dimensional model display apparatus for displaying a three-dimensional model defined within a virtual three-dimensional space. This three-dimensional model display apparatus is characterized by comprising viewpoint status-determining means for determining a line-of-sight vector indicative of a direction of viewing an inside of the virtual three-dimensional space from a viewpoint, in response to an operation input, projection condition-determining means for determining a projection condition that two-point perspective projection is selected when the line-of-sight vector determined by the viewpoint status-determining means is close to a horizontal one and a degree of influence of three-point perspective projection on two-point perspective projection increases with an increase in inclination of the line-of-sight vector with respect to a horizontal direction, image-generating means for generating an image by perspectively projecting the three-dimensional model according to the projection condition determined by the projection condition-determining means, and image display means for displaying the generated image.
The above and other objects, features and advantages of the present invention will become apparent from the following description when taken in conjunction with the accompanying drawings which illustrate a preferred embodiment of the present invention by way of example.